package com.qiangshi.realTimeInformation.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.qiangshi.common.annotation.Excel;
import com.qiangshi.common.core.domain.BaseEntity;
import com.qiangshi.common.utils.DateUtils;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.sql.Date;
import java.util.Calendar;
import java.util.Objects;

/**
 * RealTimeInformation对象 qs_real_time_information
 *
 * @author ccm
 * @date 2022-03-02
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class QsRealTimeInformation extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 箱号
     */
    @Excel(name = "箱号")
    @TableField(exist = false)
    private Integer caseNumber;
    /**
     * 温度(℃)
     */
    @Excel(name = "温度(℃)")
    private BigDecimal temperatureNum;
    /**
     * 湿度(%)
     */
    @Excel(name = "湿度(%)")
    private BigDecimal humidityNum;
    /**
     * 氨气(ppm)
     */
    @Excel(name = "氨气(ppm)")
    private BigDecimal ammoniaNum;
    /**
     * 出料实际值(g)
     */
    @Excel(name = "出料实际值(g)")
    private BigDecimal finishedWeight;
    /**
     * 投料盒数
     */
    @Excel(name = "投料盒数")
    private Integer feedBoxNum;
    /**
     * 投虫盒数
     */
    @Excel(name = "投虫盒数")
    private Integer wormBoxNum;

    /**
     * 翻盒盒数
     */
    @Excel(name = "翻盒盒数")
    private Integer finishedBoxNum;
    /**
     * 年周
     */
    @TableField(exist = false)
    private String weekOfYear;
    public String getCreateDate(){
        if(Objects.nonNull(getCreateTime())){
            return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,getCreateTime());
        }
        return "";
    }
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("createTime", getCreateTime())
                .append("temperatureNum", getTemperatureNum())
                .append("humidityNum", getHumidityNum())
                .append("ammoniaNum", getAmmoniaNum())
                .append("finishedWeight", getFinishedWeight())
                .append("feedBoxNum", getFeedBoxNum())
                .append("wormBoxNum", getWormBoxNum())
                .append("finishedBoxNum", getFinishedBoxNum())
                .toString();
    }
}
